<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet library="css" name="default.css"/>
        <h:outputStylesheet library="css" name="cssLayout.css"/>
        <title>#{messages.login}</title>
    </h:head>

    <h:body>
        <div id="top"  >
            <h:outputLabel value="#{messages.systemNameRef}" style="font-stretch: ultra-expanded; font-size: xx-large"/>
            <h:panelGrid columns="1" id="head" style="width: 100%">
                    <h:panelGrid columns="2" style="width: 100%">
                        <h:graphicImage library="images" name="top_logo.gif" style="width: 378px"/>
                        <h:panelGrid columns="1" style="vertical-align: top;align-content: flex-end" styleClass="userInfo" >
                            <h:form>
                                <c:if test="#{!checkLogin.logined}">
                                    <h:outputLabel value="#{messages.welcome}"/>
                                    <h:commandButton value="#{messages.register}" action="#{checkLogin.register}" id="register" />
                                    <h:commandButton value="#{messages.student}#{messages.login}" action="#{checkLogin.login(3)}" />
                                    <h:commandButton value="#{messages.teacher}#{messages.login}" action="#{checkLogin.login(1)}"/>
                                    <h:commandButton value="#{messages.admin}#{messages.login}" action="#{checkLogin.login(2)}" style="align-content: flex-end"/>
                                </c:if>
                                <c:if test="#{checkLogin.logined}">
                                    <h:outputLabel value="#{messages.welcome}#{checkLogin.user.name}"/>
                                    <h:commandLink action="#{checkLogin.logout}" value="#{messages.logout}" style="color:#fff;text-decoration:none;"/>
                                </c:if>
                            </h:form>
                            <h:panelGrid columns="1" styleClass="nav"/>
                        </h:panelGrid>

                    </h:panelGrid>      
                </h:panelGrid>
        </div>

            <div id="content" class="left_content">
                <ui:insert name="content">Content</ui:insert>
            </div>
        <div id="bottom">
            <h:panelGrid columns="1">
                <h:outputLabel value="#{messages.copyRight}"/>
                <h:outputLabel value="#{messages.copyRightEmail}"/>
            </h:panelGrid>
        </div>
    </h:body>

</html>
